<?php
/**
 * Created by PhpStorm.
 * User: 11893
 * Date: 2018/9/17
 * Time: 16:34
 */

namespace App\Observers;

use App\Jobs\SyncOneProductToEs;
use App\Models\Product;

class ProductObserver
{
    public function saved(Product $product)
    {
        dispatch(new SyncOneProductToEs($product));
    }

    public function created(Product $product)
    {
        dispatch(new SyncOneProductToEs($product));
    }
}